<?php
session_start();
//包含头
include '../PHP/head.php';
?>

<br />
<br />
<p class="text-center lead">报价要求</p>
<?php
//接收项目id和专业代码，从projects中搜出相应的报价要求

if(isset($_GET['project_id'])) {
	require_once ('../FNS/db_fns.php');

	$project_id = $_GET['project_id'];
	$subject = $_GET['subject'];

	$db = db_connect();
	$query="select code, name, ".$subject." from projects where id = '".$project_id."'";
	$result=$db->query ($query);
	$num_result=$result->num_rows;
	if (!$num_result) {
		echo "<br />";
		echo "<p>这是个不存在的报价项目！数据库哪个地方出问题了。</p>";
		echo "</div>";
		echo "</body>";
		$result->free();
		$db->close();
		exit;
	}
	
	$row=$result->fetch_assoc ();
	
	$project_code = stripslashes ($row['code']);
	$project_name = stripslashes ($row['name']);
	$des = stripslashes ($row[$subject]);
	
	echo "<br />";
	echo "<p>报价编号：".$project_code."</p>";
	echo "<p>项目名称：".$project_name."</p>";
	echo "<p>报价要求：".$des."</p>";

	$result->free();
	$db->close();
	} else {
	echo "<br />";
	echo "<p>请通过正常流程访问该页面！</p>";
}
?>


</div>
</body>
</html>